/*超时测试：创建一个客户端持续给服务器发送数据，判断能不能正常的超时释放*/
#include "../HttpServer.hpp"
#include <cassert>

int main()
{
    Socket cli_sock;
    cli_sock.CreateClient(8080, "127.0.0.1");
    std::string req = "GET /login HTTP/1.1\r\nConnection: keep-alive\r\nContent-Length: 0\r\n\r\n";
    while(1) {
        assert(cli_sock.Send((char*)req.c_str(), req.size()) != -1);
        char buf[1024] = {0};
        assert(cli_sock.Recv(buf, 1023));
        LOG(LogLevel::DEBUG) << buf;
        sleep(15);     //main.cpp中超市任务时间是10s，然后我们这里强制沉睡15s，看看是否会被超时
    }
    return 0;
}